logisitc regression python from scratch